package com.hs.controller;


import com.hs.config.R;
import com.hs.entity.ClassLessonIssue;
import com.hs.service.ClassLessonIssueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("classLessonIssue")
public class ClassLessonIssueController {
    @Autowired
    ClassLessonIssueService classLessonIssueService;

    @RequestMapping("insert")
    @ResponseBody
    public R insert(ClassLessonIssue record, Model model) {
        if (record == null) {
            return R.FAILURE("请填写用户名密码等关键信息", null);
        }
        if (record.getClassLessonId() == null) {
            model.addAttribute("msg", "请填getClassLessonId");
            return R.FAILURE("请填写getClassLessonId", null);
        }
        int i = classLessonIssueService.insertSelective(record);
        if (i > 0) {
            return R.SUCCESS("", i);
        }
        return R.FAILURE("", 0);
    }




}